#include <stdio.h>

#define __len(t_arr) (sizeof t_arr / sizeof *(t_arr))
#define __foreach(item,t_arr,T) for(T* item = t_arr; item < t_arr + __len(t_arr);item++)
#define foreach(var,t_arr) for(var = t_arr; var < t_arr + __len(t_arr); var++)
int main(void)
{
  int arrs[4]={1,2,3,4};
  int i = 0;
  __foreach(x, arrs,int)
  {
    printf("arr[%d]=%d\n",i,*x);
    i++;
  }

  printf("---\n");

  char arr_char[]={'h','e','l','l','o'};
  int j = 0;
  __foreach(x, arr_char,char)
  {
    printf("arr[%d]=%c\n",j,*x);
    j++;
  }
  
  printf("---\n");

  double d_arr[] = {1.2,1.3,1.4};
  int g = 0;
  double* item;
  foreach(item,d_arr)
  {
    printf("arr[%d]=%f\n",g,*item);
    g++; 
  }

  
  return 0;
}
